extends ../_layout
block content
   h1= 'Club List'
   - each club in clubs
      if(club)
         div.panel.panel-primary
               div.panel-heading
                  div.panel-title
                     a(href='/clubs/detail/' + club._id )= club.name
                     //div.btn-group.pull-right
                     //   a.btn.btn-default.btn-sm(href='/clubs/delete/' + club._id.toString()) Delete
               div.panel-body= club.description
               div.panel-footer
                  span= 'Created by ' 
                  a(href='/users/profile/' + club.creator._id)= club.creator.firstname 
                  span= ' on ' + club.createddate



//
   hr
   
   div.well
      if(user && !user.club)
         form(method='post')
            div.form-group
               div: input.form-control(type='text', name='name', placeholder='Club Name')
               div: textarea.form-control(rows='4', name='description', placeholder='Description')
            input.btn.btn-primary(type='submit', value='Create')
      else
         form.navbar-form(action='/users/login', method='post')
            div.form-group
               input.form-control(type='text', name='email', placeholder='Email')
               input.form-control(type='password', name='password', placeholder='Password')
            input.btn.btn-success(type='submit', value='Login')
   


